﻿@model PointTask
@{

    ViewData["Title"] = new string[] { "分享任务" };
    TempData["SidebarType"] = "PointTask";
    var setting = ViewData.Get<PointTaskShareSetting>("setting", null);
}

<div class="row jh-space-setup">
    @Html.Partial("_Sidebar")
    <div class="col-xs-10">
        <div class="jh-space-right jh-padding-white">
            <div class="col-xs-5">
                <div class="form-group">
                    <div class="col-xs-12">
                        <label>分享页面URL</label>
                        <input type="text" title="@setting.LinkUrl" class="form-control" value="@setting.LinkUrl" disabled="disabled" />
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-xs-12">
                        <ul class="bdsharebuttonbox list-unstyled">
                            @if (setting.ShareWeiXin == "True")
                            {
                                <li><a class="bds_weixin" data-cmd="weixin">微信朋友圈</a></li>
                            }
                            @if (setting.ShareQQ == "True")
                            {
                                <li><a class="bds_qzone" data-cmd="qzone">QQ空间</a></li>
                            }
                        </ul>
                    </div>

                </div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    require(['jquery', 'tnlayer'], function ($, tnlayer) {

        //分享插件
        window._bd_share_config = {
            common: {
                bdText: '积分任务，分享链接',
                bdUrl: '@setting.LinkUrl',
                onAfterClick: function () {
                    var url = '@CachedUrlHelper.Action("ShareCallBack", "UserSpace")';
                    $.post(url, { taskId:@Model.TaskId,userId:@UserContext.CurrentUser.UserId}, function (data) {
                    });
                }
            },
            share: [{
                //分享按钮的尺寸
                "bdSize": 16,
            }]
        }
        with (document) 0[(getElementsByTagName('head')[0] || body).appendChild(createElement('script')).src = 'http://bdimg.share.baidu.com/static/api/js/share.js?cdnversion=' + ~(-new Date() / 36e5)];


    });
</script>
